﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductComment.aspx.cs" Inherits="WebApp.Management.Product.ProductComment" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
       产品名: <asp:Label ID="Label1" runat="server"></asp:Label>
       <br />
       产品编号:<asp:Label ID="Label2" runat="server"></asp:Label>
        <asp:GridView ID="gvComment" runat="server" AutoGenerateColumns="False" 
            onrowcancelingedit="gvComment_RowCancelingEdit" 
            onrowdeleting="gvComment_RowDeleting" onrowediting="gvComment_RowEditing" 
            onrowupdating="gvComment_RowUpdating" AllowPaging="True" 
            onpageindexchanging="gvComment_PageIndexChanging">
            <Columns>
                <asp:BoundField HeaderText="评论时间" DataField="CreateTime" ReadOnly="true" />
                <asp:TemplateField HeaderText="评论">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Content") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Content") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="编辑" ShowHeader="False">
                    <EditItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Update"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                            <asp:HiddenField ID="hfCommentId" runat="server" Value='<%#Eval("CommentId") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                            CommandName="Edit" Text="Edit"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="return confirm('是否要删除?');" CausesValidation="False" 
                            CommandName="Delete"  Text="Delete"></asp:LinkButton>
                        <asp:HiddenField ID="hfCommentId" runat="server" Value='<%#Eval("CommentId") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    </form>
</body>
</html>
